basket = {"apple", "banana", "orange", "banana", "pear", "apple"}

print("Basket:", basket)

new_basket = { item for item in basket if "a" in item}

print("New basket containing items with 'a':", new_basket)

basket.remove("banana")

print("Basket after removing 'banana':", basket)



basket.clear()

print("Basket after clearing:", basket)

basket1 = {"apple", "banana", "orange", "banana", "pear", "apple"}

basket2 = {"banana", "pear", "kiwi", "grape"}

basket_insect = basket1.intersection(basket2)

print("Basket intersection:", basket_insect)

basket_union = basket1.union(basket2)

print("Basket union:", basket_union)

basket_difference = basket1.difference(basket2)


# 列出其他集合的用法

